﻿@{
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<script type="text/javascript" src="~/Scripts/bootstrap.min.js"></script>
<script src="~/Scripts/ListControl.js" type="text/javascript"></script>

<div class="form-search">
    <fieldset>
        <legend data-bind="text: title"></legend>
        <span class="pull-left">
            <!--ko foreach: searchCriteria-->
            <label class="control-label" data-bind="text: displayText"></label>
            <input class="search-query input-medium" data-bind="value: value" />
            <!--/ko-->                    
            <a href="#" data-bind = "click: search" class="btn btn-primary">Search</a>
            <a href="#" data-bind = "click: reset" class="btn">reset</a>
        </span>
        <span class="pull-right">
            <a href="#" data-bind = "click: onDataAdding" class="btn btn-primary">Add</a>
        </span>
    </fieldset>
</div>
<br/><label id="labelError" class="error"></label>
<table class="table table-striped table-bordered table-condensed">
    <thead>
        <tr data-bind="foreach: headers">
            <th data-bind="style: {width: width}" >
                <a href="#" data-bind="text: displayText, click: $root.sort"></a>
                <i class="icon-circle-arrow-up" data-bind="visible: value == $root.orderBy() && canOrder == 'true' && $root.isAsc()"> </i>
                <i class="icon-circle-arrow-down" data-bind="visible: value == $root.orderBy() && canOrder == 'true' && !$root.isAsc()" ></i> 
            </th>
        </tr>
    </thead>
    <tbody data-bind="foreach: recordSet">
        <tr>
            @RenderBody() 
            <td>
                <a href="#" data-bind="click: $root.onDataUpdating">Update</a>
                <a href="#" data-bind="click: $root.onDataDeleting">Delete</a>
                <a href="#" data-bind="visible: $root.needResetPwd(), click: $root.onDataResetPwd">ResetPassword</a>
            </td>
        </tr>
    </tbody>
</table>
 
<div class="pagination pagination-centered">
    <ul data-bind="foreach: pageNumbers">
        <li data-bind="css: {selected: $index() == $root.pageIndex() - 1}">
            <a href="#" data-bind="text: $data, click: $root.turnPage" ></a>
        </li>
    </ul>
</div>
<div class="modal fade hide" id="dialog" data-backdrop ="static" data-bind="html:dialogContent"></div>
@RenderSection("Script")
